﻿using System;
using System.Text;
using System.Collections.Generic;
using System.Linq;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using WS.EKA.Business.Model;
using WS.EKA.Business.Dal;

namespace WS.EKA.Business.Test
{
    [TestClass]
    public class DBHelperTest
    {
        [TestMethod]
        public void BulkInsertTest()
        {
            IList<Jobs> jobList = new List<Jobs>();

            jobList.Add(new Jobs
            {
                JOB_ID = "Tester1",
                JOB_TITLE = "Sr.Tester",
                MIN_SALARY = 1000,
                MAX_SALARY = 9000
            });

            IDB DBHelper = DBFactory.CreateBODB();
            DBHelper.BulkInsert(jobList);

            string obj =DBHelper.ExecuteScalar("select count(*) from jobs where job_id='Tester1'");

            DBHelper.ExecuteNonQuery("delete from jobs where job_id='Tester1'");
            Assert.AreEqual(obj, "1");
        }
    }
}
